/*
 * @Author: Marshall
 * @Date: 2024-06-02 21:03:51
 * @LastEditors: Marshall
 * @LastEditTime: 2024-06-08 21:02:11
 * @Description:
 * @FilePath: /yudao-ui-admin-vue3/src/api/scenic/comment/index.ts
 */
import request from '@/config/axios'

// 实践点评论 VO
export interface CommentVO {
  id: number // 自增主键
  memberId: number // 小程序用户id
  content: string // 评论内容
  isShow: boolean // 是否通过审核
  spotId: number // 实践点
  spotDeptId: number // 实践点部门id
  stars: string // 星星数
}

// 实践点评论 API
export const CommentApi = {
  // 查询实践点评论分页
  getCommentPage: async (data: any) => {
    return await request.post({ url: `/scenic/comment/comment_page_by_location`, data })
  },

  // 查询实践点评论详情
  getComment: async (id: number) => {
    return await request.get({ url: `/scenic/comment/get?id=` + id })
  },

  // 新增实践点评论
  createComment: async (data: CommentVO) => {
    return await request.post({ url: `/scenic/comment/create`, data })
  },

  // 修改实践点评论
  updateComment: async (data: CommentVO) => {
    return await request.put({ url: `/scenic/comment/update`, data })
  },

  // 删除实践点评论
  deleteComment: async (id: number) => {
    return await request.delete({ url: `/scenic/comment/delete?id=` + id })
  },

  // 导出实践点评论 Excel
  exportComment: async (params) => {
    return await request.download({ url: `/scenic/comment/export-excel`, params })
  }
}
